package com.deceen.demo.dao;

import com.alibaba.fastjson.JSON;
import com.deceen.demo.entity.DemoEntity;
//import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: zzx
 * @date: 2018/10/25 17:05
 * @description:
 */
@Component
public class DemoMapper {

    private static final Map<String,DemoEntity> girl = new HashMap<>();
    static {
        girl.put("zhu",new DemoEntity(1,1,"zhu",170f));
        girl.put("pig",new DemoEntity(2,2,"pig",160f));
    }

//    List<DemoEntity> getUser();
//
//    void register(@Param("username") String username,@Param("password") String password);

    public List<DemoEntity> getUser(){
        System.out.println("demo mapper_" + JSON.toJSONString(girl));
        return new ArrayList<>(girl.values());
    }

}
